package com.zhoutao.blog.seven.api;

import com.zhoutao.blog.seven.model.Response;
import com.zhoutao.blog.seven.model.detail.TagDetail;
import com.zhoutao.blog.seven.service.TagService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/api/tag")
@RequiredArgsConstructor
public class TagController {

    private final TagService tagService;

    @GetMapping
    public Response<List<TagDetail>> list() {
        List<TagDetail> list = tagService.list();
        return Response.success(list);
    }
}
